package com.zjj.algorithm.learning.niuke;

import java.util.Scanner;

/**
 * HJ57 高精度整数加法
 *
 * @author zjj_admin
 * @date 2023/2/9 22:11
 */
public class Test57 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        int len1 = s1.length();
        int len2 = s2.length();
        int len = Math.max(len1, len2);
        StringBuilder sb = new StringBuilder();
        if (len1 > len2) {
            for (int i = 0; i < len - len2; i++) {
                sb.append("0");
            }
            s2 = sb.toString() + s2;
        } else {
            for (int i = 0; i < len - len1; i++) {
                sb.append("0");
            }
            s1 = sb.toString() + s1;
        }
        String res = "";
        int power = 0;
        for (int i = len - 1; i >= 0; i--) {
            int a = Integer.parseInt(s1.substring(i, i + 1));
            int b = Integer.parseInt(s2.substring(i, i + 1));
            int num1 = a + b;
            int num2 = num1 + power;
            if (num2 >= 10) {
                power = num2 / 10;
            } else {
                power = 0;
            }
            String s = num2 % 10 + "";
            res = s + res;
        }
        if (power > 0) {
            res = power + res;
        }
        System.out.println(res);

    }
}
